import request from '@/utils/request'

// 素材分页列表
export function pagingMaterialList(query) {
  return request({
    url: '/material/projectMaterial/paging',
    method: 'get',
    params: query
  })
}

// 保存素材
export function saveMaterial(data) {
  return request({
    url: '/material/projectMaterial/save',
    method: 'post',
    data: data
  })
}

// 批量保存素材
export function saveBatchMaterial(data) {
  return request({
    url: '/material/projectMaterial/saveBatch',
    method: 'post',
    data: data
  })
}

// 删除素材
// materialIds
export function deleteMaterial(data) {
  return request({
    url: '/material/projectMaterial/deleteBatch',
    method: 'post',
    data: data
  })
}
// 获取素材已使用总大小
export function getMaterialUseTotalSize(query) {
  return request({
    url: '/material/projectMaterial/getMaterialUseTotalSize',
    method: 'get',
    params: query
  })
}

// 素材分组分页列表
export function pagingMaterialGroupList(query) {
  return request({
    url: '/material/projectMaterialGroup/paging',
    method: 'get',
    params: query
  })
}

// 素材分组列表
export function getProjectMaterialGroupList(query) {
  return request({
    url: '/material/projectMaterialGroup/getProjectMaterialGroupList',
    method: 'get',
    params: query
  })
}

// 保存素材分组
export function saveMaterialGroup(data) {
  return request({
    url: '/material/projectMaterialGroup/save',
    method: 'post',
    data: data
  })
}

// 删除素材分组
// groupIds
export function deleteMaterialGroup(data) {
  return request({
    url: '/material/projectMaterialGroup/deleteBatch',
    method: 'post',
    data: data
  })
}
